<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>考试详情</title>
    <link href="../../static/css/bootstrap.min.css" rel="stylesheet" th:href="@{/static/css/bootstrap.min.css}">
    <link href="../../static/css/dashboard.css" rel="stylesheet" th:href="@{/static/css/dashboard.css}">
</head>
<body>
<div th:insert="admin/common::topbar"></div>
<div class="container-fluid">
    <div class="row">
        <!--侧边栏-->
        <div th:insert="~{admin/common::sidebar(active='examArrange.html')}">
        </div>
        <main class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4" role="main">
            <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pb-2 mb-3 border-bottom">
                <h3>考试详情</h3>
                <div class="btn-toolbar mb-2 mb-md-0">
                    <div class="btn-group mr-2">
                        <form id="form" method="post" th:action="@{/admin/toShowExamList}">
                            <!--onblur 失去焦点产生事件-->
                            <div class="input-group">
                                <select class="form-control" id="exam_id" name="exam_id">
                                    <option th:each="exam:${examList}"
                                            th:selected="${examById.getExam_id()==exam.getExam_id()}"
                                            th:text="${exam.getExam_name()}" th:value="${exam.getExam_id()}">
                                    </option>
                                    <input hidden th:value="${page}" type="text">
                                </select>
                                <input class="input-group-addon btn btn-sm btn-primary" type="submit" value="搜索">
                            </div>
                        </form>
                    </div>
                    <div class="btn-group mr-2">
                        <button class="btn btn-primary btn-sm btn-outline-secondary" id="btn-exam-arrange">考试安排</button>
                    </div>
                    <div class="btn-group mr-2">
                        <!--<button id="btn-add-stu-exam" class="btn btn-primary btn-sm btn-outline-secondary">添加考生</button>-->

                        <button class="btn btn-primary btn-sm btn-outline-secondary" id="btn-admin">管理员</button>
                        <button class="btn btn-sm btn-outline-secondary" id="btn-student">学生端</button>
                    </div>
                </div>
            </div>
            <div class="table-responsive">
                <table class="table table-striped table-sm">
                    <thead style="background-color: #00d0ff">
                    <tr>
                        <th>考场编号</th>
                        <th>考场地点</th>
                        <th style="color: #AB9C08">考试编号</th>
                        <th style="color: #067D14">考试名称</th>
                        <th style="color: #00f729">考试科目编号</th>
                        <th style="color: #AB9C08">考试科目</th>
                        <th style="color: #067d59">考试日期</th>
                        <th style="color: #6d7d06">考试时间</th>
                        <th style="color: #207d06">第一监考人</th>
                        <th style="color: #43067d">第二监考人</th>
                        <!--  <th>安排考试学生</th>-->
                        <!-- <th>考试具体事项安排</th>-->
                    </tr>
                    </thead>
                    <tbody>
                    <tr class="examSubjectList" th:each="list:${examInfoList}">
                        <th th:text="${list.getId()}"></th>
                        <th th:text="${list.getExam_place()}"></th>
                        <th th:text="${list.getExam_id()}"></th>
                        <th th:text="${list.getExam_cname()}"></th>
                        <th th:text="${list.getExam_cid()}"></th>
                        <th th:text="${list.getExam_name()}"></th>
                        <!--    <th th:text="${list.getExam_date()==null?'未安排':list.getExam_date()}"></th>
                            <th th:text="${list.getExam_time()==null?'未安排':list.getExam_time()}"></th>
                            <th th:text="${list.getTid_first()==null?'未安排':list.getTname_first()}"></th>
                            <th th:text="${list.getTid_second()==null?'未安排':list.getTname_second()}"></th>-->
                        <th th:style="${list.getExam_date()==null||list.getExam_date()==''?'color:red':'color: #067d59'}"
                            th:text="${list.getExam_date()==null||list.getExam_date()==''?'未安排':list.getExam_date()}"></th>
                        <th th:style="${list.getExam_time()==null||list.getExam_time()==''?'color:red':'color: #6d7d06'}"
                            th:text="${list.getExam_time()==null||list.getExam_time()==''?'未安排':list.getExam_time()}"></th>
                        <th th:style="${list.getTid_first()==null||list.getTid_first()==''?'color:red':'color: #207d06'}"
                            th:text="${list.getTid_first()==null||list.getTid_first()==''?'未安排':list.getTname_first()}"></th>
                        <th th:style="${list.getTid_second()==null||list.getTid_second()==''?'color:red':'color: #43067d'}"
                            th:text="${list.getTid_second()==null||list.getTid_second()==''?'未安排':list.getTname_second()}"></th>
                        <!-- <th>

                         </th>-->
                        <!-- <th>
                             <button th:value="${list.getExam_cid()}" style="color: #899443" class="btn btn-sm  btn-outline-secondary ">考试时间安排</button>
                             <button th:value="${list.getExam_cid()}" style="color: #899443" class="btn btn-sm  btn-outline-secondary ">考场监考人员安排</button>
                         </th>-->
                    </tr>
                    </tbody>
                </table>
            </div>
            <nav aria-label="Page navigation" class="page-header">
                <ul class="pagination">
                    <li>
                        <a aria-label="Previous" id="pagePrevious"
                           th:href="@{/admin/showExamList/{exam_id}/{page}/(exam_id=${examById.getExam_id()},page=${page}-1)}"
                           th:if="${lastPage}">
                            <span aria-hidden="true">&laquo;</span>
                        </a>
                    </li>
                    <li><a class="nav active" id="page1"
                           th:href="@{/admin/showExamList/{exam_id}/{page}/(exam_id=${examById.getExam_id()},page=${page})}"
                           th:if="${number} gt 10" th:text="${page}"></a></li>
                    <li><a id="page2"
                           th:href="@{/admin/showExamList/{exam_id}/{page}/(exam_id=${examById.getExam_id()},page=${page+1})}"
                           th:if="${number} gt ${page*10}" th:text="${page}+1"></a></li>
                    <li><a id="page3"
                           th:href="@{/admin/showExamList/{exam_id}/{page}/(exam_id=${examById.getExam_id()},page=${page+2})}"
                           th:if="${number} gt ${(page+1)*10}" th:text="${page}+2"></a></li>
                    <li><a id="page4"
                           th:href="@{/admin/showExamList/{exam_id}/{page}/(exam_id=${examById.getExam_id()},page=${page+3})}"
                           th:if="${number} gt ${(page+2)*10}" th:text="${page}+3"></a></li>
                    <li><a id="page5"
                           th:href="@{/admin/showExamList/{exam_id}/{page}/(exam_id=${examById.getExam_id()},page=${page+4})}"
                           th:if="${number} gt ${(page+3)*10}" th:text="${page}+4"></a></li>
                    <li>
                        <a aria-label="Next" id="pageNext"
                           th:href="@{/admin/showExamList/{exam_id}/{page}/(exam_id=${examById.getExam_id()},page=${page}+1)}"
                           th:if="${nextPage}">
                            <span aria-hidden="true">&raquo;</span>
                        </a>
                    </li>
                </ul>
            </nav>
        </main>
    </div>
</div>
<script src="../../static/js/jquery-3.6.0.min.js" th:src="@{/static/js/jquery-3.6.0.min.js}"
        type="text/javascript"></script>
<script src="../../static/js/bootstrap.min.js" th:src="@{/static/js/bootstrap.min.js}" type="text/javascript"></script>
<script src="../../static/js/btn.js" th:src="@{/static/js/btn.js}"></script>
<script>
    let exam_id = [[${examById.getExam_id()}]];
    $(function () {
        $('#btn-exam-arrange').click(function () {
            $(location).attr('href', '/admin/getExamSubjectList/' + exam_id);
        })
    })
</script>
</body>
</html>